﻿    <script type="text/javascript">

        $(document).ready(function () {
            var ds = new datasource();
            var f = new childform();
            ds.c = "Way.Contract.Interface.ApplyForCenter";
            ds.notreload = true;
            ds.init();
            var tool = new toolstrip();
            tool.applyTo = 'menu';
            tool.datasource = ds;
            tool.issearch = false;
            tool.init();
            f.title = ds.modeldata.title;
            f.childitem = ds.modeldata.childitem;
            f.parent = ds;
            f.childfooter = ds.ischildfooter;
            f.fit = true;
            f.applyTo = "form";
            f.m = "add";
            f.init();
            $("#layout").layout();
            ds.onCommand = function (name, data) {
                ds.selectItem = f.val();
                return true;
            }
            var data = ds.load();
            if (data.total > 0) {
                f.val(data.rows[0]);
                var grid = f.findgrid(0);
                grid.clear();
                grid.insertRow(data.tag);
            }
        });
//        function saveinfo(data) {
//            ds.selectItem = f.val();
//            ds.clickcommand(data.command, data); $.messager.show({ title: '消息', msg: '保存完成。', showType: 'show' });
//        }
     </script>
<div  border="false" class="easyui-layout" fit="true" id="layout">
<div border="true" region="north" style="height:30px;"><div id="menu"/></div>
<div border="false" region="center"><div id="form"/></div>
</div>
